# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-django-annoying
#_pkgreal is used by apkbuild-pypi to find modules at PyPI
_pkgreal=django-annoying
pkgver=0.10.6
pkgrel=1
pkgdesc="This is a django application that tries to eliminate annoying things in the Django framework."
url="https://pypi.python.org/project/django-annoying"
arch="noarch"
license="BSD"
depends="py3-django py3-six py3-flake8 py3-isort"
checkdepends="python3-dev py3-pytest py3-pytest-django"
makedepends="py3-setuptools py3-gpep517 py3-wheel"
source="
	$pkgname-$pkgver.tar.gz::https://codeload.github.com/skorokithakis/django-annoying/tar.gz/refs/tags/v$pkgver
	101_update-tests-for-django-4-compatibility.patch
	"
builddir="$srcdir/$_pkgreal-$pkgver"
subpackages="$pkgname-pyc"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	DJANGO_SETTINGS_MODULE=tests.settings .testenv/bin/python3 -m pytest -v
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
8d04fd79b4c0f59b746d27ce7539a0f5dc3d0f2290eca30ddbf05e9f0d915f2138356d7dab4385c7deb1860c880f62539a0908c0520ce141afd014a8ec34aaa7  py3-django-annoying-0.10.6.tar.gz
a19089852d3b39a9fd563eb0ddc6117ad7c01d905b588d59014a41aa45ebb1eb8007174419582cf4f9bfba6c665c04a4a2ecb04dd9f229aa41b95b7d5912f3c6  101_update-tests-for-django-4-compatibility.patch
"
